/**
 * 开通活期账户
 * @returns
 */
$("#u-trintoinOpenCurrent").click(function(){
	$.post(g_requestContextPath + "/p/currentOpen",function(data){
		var jsonData = toJson(data);
		if(jsonData.head.status == 'SUCCESS'){
			layer.confirm("已成功为您开通金贝零钱", {
				  btn: ['确定'] //按钮
				}, function(){
				  window.location.reload();
				}, function(){
					
				});
		}else{
			layer.msg("开通失败，请稍后重试");
		}
	});
});

/**
 * 转入活期
 * @returns
 */
$("#u-trintoinPutIn").click(function(){
	if($.trim($("#currentPutInAmount").val()).length == 0){
		$(".input-error").html("金额不能为空");
		return false;
	}else if(parseInt($("#currentPutInAmount").val()) < 100){
		$(".input-error").html("金额不能为小于100元");
		return false;
	}else{
		$(".input-error").html("");
		$("#u-trintoinPutIn").attr("disabled",true);
		$.post(g_requestContextPath + "/p/currentIn",{"amount":$("#currentPutInAmount").val(),"token":$("#tokenCurrent").val()},function(data){
			if(toJson(data).head.status == 'SUCCESS'){
				layer.confirm(toJson(data).head.memo, {
					  btn: ['确定'] //按钮
					}, function(){
					  window.location.reload();
					}, function(){
						
					});
			}else if('isSubmitting' == data){
				layer.msg("正在处理请求，请稍等");
				$("#u-trintoinPutIn").removeAttr("disabled");
			}else{
				layer.msg(toJson(data).head.memo);
				$("#u-trintoinPutIn").removeAttr("disabled");
			}
		});
	}
});